package cn.gson.springboot.model.dao.afterdao;

import cn.gson.springboot.model.pjos.CustomerCare;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface CustomerCareDao  extends CrudRepository<CustomerCare, Integer> {
//    根据客户id查询客户关怀
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "select * from customer_care where custom_id = ?1")
    public List<CustomerCare> selectCustomerCare(Integer congId);

//    合并
    @Transactional
    @Modifying
    @Query(nativeQuery = true,value = "update customer_care set custom_id = ?1 where custom_id = ?2")
    public void update(Integer daoId,Integer congId);
}
